<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增回款计划')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-payPlan-add">
        	<input name="customerId" type="hidden" id="customerId" />
        	<input name="orderId" type="hidden" id="orderId" />
        	<div class="form-group">    
                <label class="col-sm-3 control-label">回款主题：</label>
                <div class="col-sm-8">
                    <input name="planName" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">客户名称：</label>
                <div class="col-sm-8">                    
                    <div class="input-group">
                     	<input name="customerName" onclick="selectCustomer()" id="customerName" type="text" placeholder="请选择所属客户 " class="form-control" required readonly>
	                	<span class="input-group-addon"><i class="fa fa-search"></i></span>
					</div>	
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">成交订单：</label>
                <div class="col-sm-8">
                    <div class="input-group">
                    	<input name="orderName" onclick="selectOrder()" id="orderName" type="text" placeholder="请选择成交订单 " class="form-control" required readonly>
                		<span class="input-group-addon"><i class="fa fa-search"></i></span>
                	</div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">计划回款金额：</label>
                <div class="col-sm-8">
                    <input name="planMoney" class="form-control" type="number" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">计划回款时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                        <input name="planDate" class="form-control" placeholder="yyyy-MM-dd HH:mm" type="text">
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">计划回款方式：</label>
                <div class="col-sm-8">
                    <select name="planType" class="form-control m-b" th:with="type=${@dict.getType('pay_type')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">期次：</label>
                <div class="col-sm-8">
                    <select name="planTimes" class="form-control m-b" th:with="type=${@dict.getType('pay_times')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">已回款：</label>
                <div class="col-sm-8">
                    <input name="payedMoney" class="form-control" type="number">
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script type="text/javascript">
        var prefix = ctx + "crm/payPlan"
        $("#form-payPlan-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-payPlan-add').serialize());
            }
        }

        $("input[name='planDate']").datetimepicker({
        });
    </script>
    <script src="../static/crm/customer.js" th:src="@{/crm/common.js}"></script>
</body>
</html>